@*
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
}
<div class="bg-gray">



	<header class="mui-bar mui-bar-nav head-bar-nav">
		<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href='@Url.Action("Index")'></a>
		<h1 class="mui-title">手机号</h1>
	</header>
	<!--DOM -->
	<div class="mui-content bg-gray">
		<!---->
		<div class="mui-input-group mui-content-padded personal-data-name-input">
			<input type="text" id="address" value="@Context.Request.Query["address"]" placeholder="请输入地址" />
		</div>
		<!---->
		<br /><br />
		<div class="mui-content-padded">
			<button class="mui-btn mui-btn-block mui-btn-green personalData-btn">
				确定
			</button>
		</div>
	</div>
</div>

@section Scripts{
<script>
	$(".personalData-btn").click(function() {
		if ($("#address").val().length == 0) {
			layerm.open({
				content: "请输入地址",
				btn: '确定',
			})
			return false;
		}

		$.ajax({
			type: 'post',
			url: '@Url.Action("EditAddress")',
			data: {
				address:$.trim($("#address").val())
			},
			success:function(result){
				if (result.state=="ok") {
					layerm.open({
					content: result.msg
					,btn: '确定',
					yes:function () {
						location.href='@Url.Action("Index","MyInfo")';
					}
					});

				}else if(result.state=="login"){
					location.href='@Url.Action("Index","Login")';
				}else{
					layerm.open({
					content: result.msg
					,btn: '确定',
					yes:function () {
						location.href='@Url.Action("Index","MyInfo")';
					}
					});
				}
			}
		})



	})




</script>
}
